home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DATETIME.SWG / 0018_TIME3.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  533b  |  35 lines

  1. { DAVID DRZYZGA }
  2.  
  3. Program timetest;
  4. Uses
  5.   Dos;
  6.  
  7. Function time : String;
  8. Var
  9.   reg     : Registers;
  10.   h, m, s : String[2];
  11.  
  12.   Function tch(s : String) : String;
  13.   Var
  14.     temp : String[2];
  15.   begin
  16.     temp := s;
  17.     if length(s) < 2 then
  18.       tch := '0' + temp
  19.     else
  20.       tch := temp;
  21.   end;
  22.  
  23. begin
  24.   reg.ax := $2c00;
  25.   intr($21, reg);
  26.   str(reg.cx shr 8, h);
  27.   str(reg.cx mod 256, m);
  28.   str(reg.dx shr 8, s);
  29.   time := tch(h) + ':' + tch(m) + ':' + tch(s);
  30. end;
  31.  
  32. begin
  33.   Writeln(time);
  34. end.
  35.